import React from 'react';
import {Tag} from "antd";
import {TagProps} from "antd/lib/tag";
import omit from 'omit.js';

export interface StatusTagProps extends TagProps {
  status: boolean,
  trueLable: string,
  falseLable?: string,
}

/**
 * 数据字段组件-下拉菜单展示
 */
const StatusTag = function (props: StatusTagProps) {
  const compProps = omit(props, ['status','trueLable','falseLable']);
  return (
    <Tag {...compProps}
         color={props.status ? '#5cb85c' : '#d9534f'}>{props.status ? props.trueLable : props.falseLable || props.trueLable}</Tag>
  );
};

export default StatusTag;

